package com.app.micaihu.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import com.app.micaihu.base.AppBaseAdapter;
import com.app.micaihu.bean.news.VideoTranslate;
import com.app.micaihu.custom.view.dataview.VideoChannelView1;

import java.util.List;

/**
 * 视频列表适配器
 * Created by linkai on 2016/9/7.
 */
public class VideoAdapter1 extends AppBaseAdapter<VideoTranslate> {

    public VideoAdapter1(List<VideoTranslate> list, Context context) {
        super(list, context);
    }

    @Override
    public View creatView(int position, View convertView, ViewGroup parent) {

        VideoChannelView1 viewholder;
        if(convertView == null){
            viewholder = new VideoChannelView1(context);
            convertView = viewholder;
            convertView.setTag(viewholder);
        }else{
            viewholder = (VideoChannelView1) convertView.getTag();
        }
        VideoTranslate newsEntity = list.get(position);
        if(newsEntity == null){
            return convertView;
        }
        viewholder.setData(newsEntity);
        return convertView;
    }
}
